trigger referralStatusUpdate on Opportunity (after insert, after update, before insert,before update) {

if ((trigger.isAfter && trigger.isUpdate) || Trigger.isInsert)
    {
        LodhaReferralDetailsUtilities.updateOpportunityReferralDetails(trigger.new);
    }
    if((trigger.Isbefore&& trigger.Isinsert)|| (trigger.isupdate && trigger.Isbefore  )){
        BookingDetailsTrgController flatCodeObj= new BookingDetailsTrgController();
        list<Opportunity> lstOpps = flatCodeObj.createSrcRefFlatCode(trigger.new);
    }
}